package com.java.crazy.part6.t9;

import com.java.crazy.base.BaseClass;

public class Test69 extends BaseClass {
    public static void main(String[] args) {

        runMethod(DayOfWeek.ONE);
        runMethod(DayOfWeek.TWO);
    }

    private static void runMethod(DayOfWeek dayOfWeek) {
        switch (dayOfWeek) {
            case ONE:
                //*********************  打印枚举 ***************************/
                logi("*********************  打印枚举属性值 ***************************");
                for (SeasonEnum s : SeasonEnum.values()) {
                    DemoPrint(s);
                }
                break;
            case TWO:
                logi("\n");
                logi("*********************  设置枚举值 实现接口 ***************************");
                SeasonEnum day = Enum.valueOf(SeasonEnum.class, "SPRING");
                logi(day + "_" + day.getName() + "_" + day.returnInfo());
                day.info();
                break;
            case THREE:
//                logi("秋天" + print);
                break;
            case FOUR:
//                logi("冬天" + print);
                break;
        }

    }

    /**
     * 打印枚举
     *
     * @param seasonEnum 枚举
     */
    private static void DemoPrint(SeasonEnum seasonEnum) {
        String print = "_" + seasonEnum.toString() + "_" + seasonEnum.name() + "_"
                + seasonEnum.ordinal() + "_" + seasonEnum.compareTo(SeasonEnum.SPRING);
        switch (seasonEnum) {
            case SPRING:
                logi("春天" + print);
                break;
            case SUMMER:
                logi("夏天" + print);
                break;
            case FALL:
                logi("秋天" + print);
                break;
            case WINTER:
                logi("冬天" + print);
                break;
        }
    }

}
